from django.db import models

# Create your models here.
class test(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=50,null=False)


class userInfo(models.Model):
    userName = models.CharField(max_length=20,null=False)
    passWord = models.CharField(max_length=20,null=False)
    showName = models.CharField(max_length=10,null=False)
    role = models.CharField(max_length=1, default='1')
    status = models.CharField(max_length=1,default='1');

class projectInfo(models.Model):
    projectName = models.CharField(max_length=20,null=False)
    projectRemark = models.CharField(max_length=200)
    status = models.CharField(max_length=1,null=False,default='1')
    createDate = models.DateField(auto_now=True,null=True)

class projectAndWorkerRelations(models.Model):
    userId = models.IntegerField(null=True)
    projectId = models.IntegerField(null=True)


class bugs(models.Model):
    projectId = models.IntegerField(null=True)
    userId = models.IntegerField(null=True)
    caseId = models.IntegerField(null=True)
    caseDetailId = models.IntegerField(null=True)
    title = models.CharField(null=True,max_length=50)
    style = models.IntegerField(null=True)
    comment = models.CharField(null=True,max_length=1000)
    addTime = models.DateField(auto_now=True)
    imgId = models.CharField(max_length=50,null=True)
    state = models.CharField(max_length=1,null=True)
    stage = models.CharField(max_length=1,null=True)
    machineId = models.CharField(max_length=50,null=True)


class bugStyle(models.Model):
    styleName = models.CharField(null=False,max_length=20)


class caseInfo(models.Model):
    caseTitle = models.CharField(max_length=100,null=False)
    status = models.CharField(max_length=1,default='1',null=False)
    position = models.IntegerField(default=0)


class caseDetail(models.Model):
    caseTitleId = models.IntegerField(null=False)
    caseDetailTitle = models.CharField(max_length=100,default='None Name')
    caseContent = models.CharField(max_length=2000)
    status = models.CharField(max_length=1,default='1')
    position = models.IntegerField(default=0)


class projectAndCaseRelations(models.Model):
    projectId = models.CharField(max_length=50,null=True)
    caseId = models.CharField(max_length=50,null=True)
    status = models.CharField(max_length=50,null=True)

class notebookAndCellPhoneAndPadInfos(models.Model):
    name = models.CharField(max_length=50,null=True)
    pn = models.CharField(max_length=20,null=True)
    mainInfo = models.CharField(max_length=1000,null=True)

class projectAndMachineInfo(models.Model):
    projectId = models.CharField(max_length=50,null=True)
    pn = models.CharField(max_length=20,null=True)
    userId = models.CharField(max_length=50,null=True)
    stage = models.CharField(max_length=1,null=True)
    machineId = models.CharField(max_length=50,null=True)
    startDate = models.DateField(auto_now=True)


class uploadImg(models.Model):
    img = models.ImageField(upload_to='img')
    bugId = models.IntegerField(null=True)
    imgName = models.CharField(max_length=100,null=True)
